function loadMdSummonSel(idCanvas) {

	var TxtFont1 = 'bold 32px  "Meiryo", "MS PGothic", "ヒラギノ角ゴ Pro W3", "Osaka", "Verdana", "arial", "sans-serif"';
	var TxtFont2 = 'bold 48px  "ＭＳ 明朝", "平成明朝", "Meiryo", "MS PGothic", "ヒラギノ角ゴ Pro W3", "Osaka", "Verdana", "arial", "sans-serif"';
	var TxtFont3 = 'bold 14px  "Meiryo", "MS PGothic", "ヒラギノ角ゴ Pro W3", "Osaka", "Verdana", "arial", "sans-serif"';
	var TxtFont4 = 'bold 11px  "Meiryo", "MS PGothic", "ヒラギノ角ゴ Pro W3", "Osaka", "Verdana", "arial", "sans-serif"';
	var TxtFont5 = 'bold 18px  "Meiryo", "MS PGothic", "ヒラギノ角ゴ Pro W3", "Osaka", "Verdana", "arial", "sans-serif"';
	var TxtFont6 = 'bold 40px  "ＭＳ 明朝", "平成明朝", "Meiryo", "MS PGothic", "ヒラギノ角ゴ Pro W3", "Osaka", "Verdana", "arial", "sans-serif"';

	sSummonFlg = 0;
	ssBubbleFlg = 0;
	ssKJSel1 = 0;
	ssKJSel2 = 0;
	ssKJSel3 = 0;
	ssSelFlg = 0;
	ssBtnFlg = 0;
	pgStatus = 0;
	b_Flg1 = 0;
	b_Flg2 = 0;
	b_Flg3 = 0;
	var checkTxt = '';
	var delLabel = '消';
	pageNum = 1;
	pageNumMax = 4;
	levelBook = 1;
	var ssmnKJTxt1 = '';
	var ssmnKJTxt2 = '';
	var ssmnKJTxt3 = '';
	var discText = '';

	jc.start(idCanvas, true);

	// 召喚所画像の描画
	jc.rect(0, 0, 290, 250, 'rgba(255,156,135,0.5)', 1);
	jc.rect(10, 60, 270, 130, 'rgba(255,255,255,1)', 1);

	jc.rect(20, 70, 60, 60, 'rgba(0,0,0,1)', 0).click(function() {
		if (jc('#K1SBpText').string() != '') {
			if (ssKJSel1 == 0 && ssKJSel2 == 0 && ssKJSel3 == 0) {
				jc('#ssKJRect1').color('rgba(0,0,255,0.5)').attr('fill', 1);
				ssKJSel1 = 1;
			} else {
				jc('#ssKJRect1').color('rgba(0,0,0,1)').attr('fill', 0);
				ssKJSel1 = 0;
			}
		}
	}).id('ssKJRect1').layer('L_S_KJ01');

	jc.rect(115, 70, 60, 60, 'rgba(0,0,0,1)', 0).click(function() {
		if (jc('#K2SBpText').string() != '') {
			if (ssKJSel1 == 0 && ssKJSel2 == 0 && ssKJSel3 == 0) {
				jc('#ssKJRect2').color('rgba(0,0,255,0.5)').attr('fill', 1);
				ssKJSel2 = 1;
			} else {
				jc('#ssKJRect2').color('rgba(0,0,0,1)').attr('fill', 0);
				ssKJSel2 = 0;
			}
		}
	}).id('ssKJRect2').layer('L_S_KJ02');

	jc.rect(210, 70, 60, 60, 'rgba(0,0,0,1)', 0).click(function() {
		if (jc('#K3SBpText').string() != '') {
			if (ssKJSel1 == 0 && ssKJSel2 == 0 && ssKJSel3 == 0) {
				jc('#ssKJRect3').color('rgba(0,0,255,0.5)').attr('fill', 1);
				ssKJSel3 = 1;
			} else {
				jc('#ssKJRect3').color('rgba(0,0,0,1)').attr('fill', 0);
				ssKJSel3 = 0;
			}
		}
	}).id('ssKJRect3').layer('L_S_KJ03');

	jc.text('', 50, 115, 'rgb(0,0,0)').id('ssKJText1').font(TxtFont2).align('center').layer('L_S_KJ01');
	jc.text('', 145, 115, 'rgb(0,0,0)').id('ssKJText2').font(TxtFont2).align('center').layer('L_S_KJ02');
	jc.text('', 240, 115, 'rgb(0,0,0)').id('ssKJText3').font(TxtFont2).align('center').layer('L_S_KJ03');
	jc.text('', 0, 0, 'rgb(0,0,0)').id('ssKJTextDummy').visible(false);
	jc.text('', 0, 0, 'rgb(0,0,0)').id('ssKJLevel1').visible(false);
	jc.text('', 0, 0, 'rgb(0,0,0)').id('ssKJLevel2').visible(false);
	jc.text('', 0, 0, 'rgb(0,0,0)').id('ssKJLevel3').visible(false);

	jc.text('体：', 20, 147, 'rgb(0,0,0)').font(TxtFont4).layer('L_S_KJ01');
	jc.text('攻：', 20, 162, 'rgb(0,0,0)').font(TxtFont4).layer('L_S_KJ01');
	jc.text('属：', 20, 178, 'rgb(0,0,0)').font(TxtFont4).layer('L_S_KJ01');
	jc.text('体：', 115, 147, 'rgb(0,0,0)').font(TxtFont4).layer('L_S_KJ02');
	jc.text('攻：', 115, 162, 'rgb(0,0,0)').font(TxtFont4).layer('L_S_KJ02');
	jc.text('属：', 115, 178, 'rgb(0,0,0)').font(TxtFont4).layer('L_S_KJ02');
	jc.text('体：', 210, 147, 'rgb(0,0,0)').font(TxtFont4).layer('L_S_KJ03');
	jc.text('攻：', 210, 162, 'rgb(0,0,0)').font(TxtFont4).layer('L_S_KJ03');
	jc.text('属：', 210, 178, 'rgb(0,0,0)').font(TxtFont4).layer('L_S_KJ03');

	jc.text('', 45, 147, 'rgb(0,0,0)').id('K1SBpText').font(TxtFont4).opacity(0).layer('L_S_KJ01');
	jc.text('', 45, 162, 'rgb(0,0,0)').id('K1SApText').font(TxtFont4).opacity(0).layer('L_S_KJ01');
	jc.text('', 45, 178, 'rgb(0,0,0)').id('K1STypeText').font(TxtFont4).opacity(0).layer('L_S_KJ01');
	jc.text('', 140, 147, 'rgb(0,0,0)').id('K2SBpText').font(TxtFont4).opacity(0).layer('L_S_KJ02');
	jc.text('', 140, 162, 'rgb(0,0,0)').id('K2SApText').font(TxtFont4).opacity(0).layer('L_S_KJ02');
	jc.text('', 140, 178, 'rgb(0,0,0)').id('K2STypeText').font(TxtFont4).opacity(0).layer('L_S_KJ02');
	jc.text('', 235, 147, 'rgb(0,0,0)').id('K3SBpText').font(TxtFont4).opacity(0).layer('L_S_KJ03');
	jc.text('', 235, 162, 'rgb(0,0,0)').id('K3SApText').font(TxtFont4).opacity(0).layer('L_S_KJ03');
	jc.text('', 235, 178, 'rgb(0,0,0)').id('K3STypeText').font(TxtFont4).opacity(0).layer('L_S_KJ03');

	// 筆画像の描画
	var imgSS01 = new Image();
	imgSS01.src = '/static/image/pen.png';
	imgSS01.onload = function() {
		jc.image(imgSS01, 60, 170, 30, 45, 0, 0, 52, 74).id('ICON_SEL_PEN').layer('L_SS_Btn');
	}

	jc.rect(10, 200, 120, 38, 'rgba(256,153,0)', 1).shadow({
		x : 5,
		y : 5,
		color : '#000000'
	}).id('Btn_SSumon').mouseover(function() {
		jc('#Btn_SSumonLabel').color('rgb(255,255,0)');
	}).mouseout(function() {
		jc('#Btn_SSumonLabel').color('rgb(0,0,0)');
	}).click(function() {
		if (jc('#ssKJText1').string() == '' && jc('#ssKJText2').string() == '' && jc('#ssKJText3').string() == '') {
			alert("最低１文字は漢字を選んで下さい");
		} else {
			if (ssBtnFlg == 0) {
				ssBtnFlg = 1;

				if(jc('#K1SBpText').string() == ''){
					ssmnKJTxt1 = jc('#ssKJText1').string();
					jc('#K1SBpText').opacity(0);
					jc('#K1SApText').opacity(0);
					jc('#K1STypeText').opacity(0);
					b_Flg1 = 1;
				} else {
					ssmnKJTxt1 = '';
					b_Flg1 = 0;
				}
				if(jc('#K2SBpText').string() == ''){
					ssmnKJTxt2 = jc('#ssKJText2').string();
					jc('#K2SBpText').opacity(0);
					jc('#K2SApText').opacity(0);
					jc('#K2STypeText').opacity(0);
					b_Flg2 = 1;
				} else {
					ssmnKJTxt2 = '';
					b_Flg2 = 0;
				}
				if(jc('#K3SBpText').string() == ''){
					b_Flg3 = 1;
					ssmnKJTxt3 = jc('#ssKJText3').string();
					jc('#K3SBpText').opacity(0);
					jc('#K3SApText').opacity(0);
					jc('#K3STypeText').opacity(0);

				} else {
					b_Flg3 = 0;
					ssmnKJTxt3 = '';
				}

				if(ssmnKJTxt1 == '' && ssmnKJTxt2 == '' && ssmnKJTxt3 == ''){
					alert("全部の漢字が召喚済みです");
					ssBtnFlg = 0;
					return;
				} else {
					var SSM_1d = new Date();
					$.getJSON('../main/mdSummonSelKanji' + '?_=' + SSM_1d.getMilliseconds(), {
						userId : userId,
						summonTxt1 : ssmnKJTxt1,
						summonTxt2 : ssmnKJTxt2,
						summonTxt3 : ssmnKJTxt3,
						summonLvl1 : jc('#ssKJLevel1').string(),
						summonLvl2 : jc('#ssKJLevel2').string(),
						summonLvl3 : jc('#ssKJLevel3').string()
					}, callbackSummonSel1, "json");
					interval_SS1 = setInterval(SSmnStartBubble, 200);
					interval_SS2 = setInterval(SSmnStopBubble, 2000);
				}
			}
		}
	}).layer('L_SS_Btn');

	jc.text('召　喚', 70, 232, 'rgb(0,0,0)').font(TxtFont1).align('center').id('Btn_SSumonLabel').mouseover(function() {
		this.color('rgb(255,255,0)');
	}).mouseout(function() {
		this.color('rgb(0,0,0)');
	}).layer('L_SS_Btn');

	jc.rect(150, 200, 120, 38, 'rgba(256,153,0)', 1).shadow({
		x : 5,
		y : 5,
		color : '#000000'
	}).id('Btn_Clear').layer('L_SS_Btn');

	jc.text('クリア', 210, 232, 'rgb(0,0,0)').font(TxtFont1).align('center').mouseover(function() {
		this.color('rgb(255,255,0)');
	}).mouseout(function() {
		this.color('rgb(0,0,0)');
	}).click(function() {
		if (ssBtnFlg == 0) {
			jc('#ssKJText1').string('');
			jc('#ssKJText2').string('');
			jc('#ssKJText3').string('');
			jc('#ssKJLevel1').string('');
			jc('#ssKJLevel2').string('');
			jc('#ssKJLevel3').string('');
			jc('#K1SBpText').string('').opacity(0);
			jc('#K1SApText').string('').opacity(0);
			jc('#K1STypeText').string('').opacity(0);
			jc('#K2SBpText').string('').opacity(0);
			jc('#K2SApText').string('').opacity(0);
			jc('#K2STypeText').string('').opacity(0);
			jc('#K3SBpText').string('').opacity(0);
			jc('#K3SApText').string('').opacity(0);
			jc('#K3STypeText').string('').opacity(0);
			jc('#ssKJRect1').color('rgba(0,0,0,1)').attr('fill', 0);
			jc('#ssKJRect2').color('rgba(0,0,0,1)').attr('fill', 0);
			jc('#ssKJRect3').color('rgba(0,0,0,1)').attr('fill', 0);
			ssKJSel1 = 0;
			ssKJSel2 = 0;
			ssKJSel3 = 0;
			levelBook = 0;
		}
	}).layer('L_SS_Btn');

	jc.rect(0, 250, 290, 180, 'rgba(180,180,180,1)', 1);
	jc.rect(15, 257, 255, 125, 'rgba(255,255,255,1)', 1);

	// 上段
	jc.rect(25, 267, 53, 48, 'rgba(0,0,0,1)', 0).id('hd01SS').layer('L_hd01SS');
	jc.rect(85, 267, 53, 48, 'rgba(0,0,0,1)', 0).id('hd02SS').layer('L_hd02SS');
	jc.rect(145, 267, 53, 48, 'rgba(0,0,0,1)', 0).id('hd03SS').layer('L_hd03SS');
	jc.rect(205, 267, 53, 48, 'rgba(0,0,0,1)', 0).id('hd04SS').layer('L_hd04SS');
	jc.rect(25, 267, 53, 48, 'rgba(0,0,0,1)', 0).id('hdHdn01SS').opacity(0).layer('L_hd01SS');
	jc.rect(85, 267, 53, 48, 'rgba(0,0,0,1)', 0).id('hdHdn02SS').opacity(0).layer('L_hd02SS');
	jc.rect(145, 267, 53, 48, 'rgba(0,0,0,1)', 0).id('hdHdn03SS').opacity(0).layer('L_hd03SS');
	jc.rect(205, 267, 53, 48, 'rgba(0,0,0,1)', 0).id('hdHdn04SS').opacity(0).layer('L_hd04SS');
	jc.text(hdTxt01, 27, 307, 'rgb(0,0,0)').id('hdText01SS').font(TxtFont2).opacity(1).layer('L_hd01SS');
	jc.text(hdTxt02, 87, 307, 'rgb(0,0,0)').id('hdText02SS').font(TxtFont2).opacity(1).layer('L_hd02SS');
	jc.text(hdTxt03, 147, 307, 'rgb(0,0,0)').id('hdText03SS').font(TxtFont2).opacity(1).layer('L_hd03SS');
	jc.text(hdTxt04, 207, 307, 'rgb(0,0,0)').id('hdText04SS').font(TxtFont2).opacity(1).layer('L_hd04SS');

	jc.text(delLabel, 27, 307, 45, 'rgb(255,0,0)').id('hdDel01SS').font(TxtFont2).opacity(0).layer('L_hd01SS');
	jc.text(delLabel, 87, 307, 45, 'rgb(255,0,0)').id('hdDel02SS').font(TxtFont2).opacity(0).layer('L_hd02SS');
	jc.text(delLabel, 147, 307, 45, 'rgb(255,0,0)').id('hdDel03SS').font(TxtFont2).opacity(0).layer('L_hd03SS');
	jc.text(delLabel, 207, 307, 45, 'rgb(255,0,0)').id('hdDel04SS').font(TxtFont2).opacity(0).layer('L_hd04SS');

	// 下段
	jc.rect(25, 324, 53, 48, 'rgba(0,0,0,1)', 0).id('hd05SS').layer('L_hd05SS');
	jc.rect(85, 324, 53, 48, 'rgba(0,0,0,1)', 0).id('hd06SS').layer('L_hd06SS');
	jc.rect(145, 324, 53, 48, 'rgba(0,0,0,1)', 0).id('hd07SS').layer('L_hd07SS');
	jc.rect(205, 324, 53, 48, 'rgba(0,0,0,1)', 0).id('hd08SS').layer('L_hd08SS');
	jc.rect(25, 324, 53, 48, 'rgba(0,0,0,1)', 0).id('hdHdn05SS').opacity(0).layer('L_hd05SS');
	jc.rect(85, 324, 53, 48, 'rgba(0,0,0,1)', 0).id('hdHdn06SS').opacity(0).layer('L_hd06SS');
	jc.rect(145, 324, 53, 48, 'rgba(0,0,0,1)', 0).id('hdHdn07SS').opacity(0).layer('L_hd07SS');
	jc.rect(205, 324, 53, 48, 'rgba(0,0,0,1)', 0).id('hdHdn08SS').opacity(0).layer('L_hd08SS');
	jc.text(hdTxt05, 27, 364, 'rgb(0,0,0)').id('hdText05SS').font(TxtFont2).opacity(1).layer('L_hd05SS');
	jc.text(hdTxt06, 87, 364, 'rgb(0,0,0)').id('hdText06SS').font(TxtFont2).opacity(1).layer('L_hd06SS');
	jc.text(hdTxt07, 147, 364, 'rgb(0,0,0)').id('hdText07SS').font(TxtFont2).opacity(1).layer('L_hd07SS');
	jc.text(hdTxt08, 207, 364, 'rgb(0,0,0)').id('hdText08SS').font(TxtFont2).opacity(1).layer('L_hd08SS');

	jc.text(delLabel, 27, 364, 45, 'rgb(255,0,0)').id('hdDel05SS').font(TxtFont2).opacity(0).layer('L_hd05SS');
	jc.text(delLabel, 87, 364, 45, 'rgb(255,0,0)').id('hdDel06SS').font(TxtFont2).opacity(0).layer('L_hd06SS');
	jc.text(delLabel, 147, 364, 45, 'rgb(255,0,0)').id('hdDel07SS').font(TxtFont2).opacity(0).layer('L_hd07SS');
	jc.text(delLabel, 207, 364, 45, 'rgb(255,0,0)').id('hdDel08SS').font(TxtFont2).opacity(0).layer('L_hd08SS');

	for (i = 1; i <= 8; i++) {
		checkTxt = jc('#hdText0' + (i) + 'SS').string();
		if (checkTxt != '') {
			if (checkTxt == useTxt01 || checkTxt == useTxt02 || checkTxt == useTxt03) {
				jc('#hd0' + (i) + 'SS').color('rgba(0,255,0,1)');
			}
		}
	}

	jc('#hdHdn01SS').click(function() {
		if (ssKJSel1 == 1) {
			HDKJclick(ssSelFlg, '#hdText01SS', '#ssKJText1', '#K1SBpText', '#K1SApText', '#K1STypeText', '#hdDel01SS', '#ssKJRect1');
			if (jc('#ssKJRect1').attr('fill') == 0) {
				ssKJSel1 = 0;
			}
		} else if (ssKJSel2 == 1) {
			HDKJclick(ssSelFlg, '#hdText01SS', '#ssKJText2', '#K2SBpText', '#K2SApText', '#K2STypeText', '#hdDel01SS', '#ssKJRect2');
			if (jc('#ssKJRect2').attr('fill') == 0) {
				ssKJSel2 = 0;
			}
		} else if (ssKJSel3 == 1) {
			HDKJclick(ssSelFlg, '#hdText01SS', '#ssKJText3', '#K2SBpText', '#K2SApText', '#K2STypeText', '#hdDel01SS', '#ssKJRect3');
			if (jc('#ssKJRect3').attr('fill') == 0) {
				ssKJSel3 = 0;
			}
		} else {
			jc('#KJ_DTxtSS').string(jc('#hdText01SS').string());
			jc('#KJDSBpText').string(kanji01Bp);
			jc('#KJDSApText').string(kanji01Ap);
			jc('#KJDSTypeText').string(kanji01TypeTxt);
			HDKJclick(ssSelFlg, '#hdText01SS', '#ssKJTextDummy', '', '', '', '#hdDel01SS', '');
		}
	});

	jc('#hdHdn02SS').click(function() {
		if (ssKJSel1 == 1) {
			HDKJclick(ssSelFlg, '#hdText02SS', '#ssKJText1', '#K1SBpText', '#K1SApText', '#K1STypeText', '#hdDel02SS', '#ssKJRect1');
			if (jc('#ssKJRect1').attr('fill') == 0) {
				ssKJSel1 = 0;
			}
		} else if (ssKJSel2 == 1) {
			HDKJclick(ssSelFlg, '#hdText02SS', '#ssKJText2', '#K2SBpText', '#K2SApText', '#K2STypeText', '#hdDel02SS', '#ssKJRect2');
			if (jc('#ssKJRect2').attr('fill') == 0) {
				ssKJSel2 = 0;
			}
		} else if (ssKJSel3 == 1) {
			HDKJclick(ssSelFlg, '#hdText02SS', '#ssKJText3', '#K3SBpText', '#K3SApText', '#K3STypeText', '#hdDel02SS', '#ssKJRect3');
			if (jc('#ssKJRect3').attr('fill') == 0) {
				ssKJSel3 = 0;
			}
		} else {
			jc('#KJ_DTxtSS').string(jc('#hdText02SS').string());
			jc('#KJDSBpText').string(kanji02Bp);
			jc('#KJDSApText').string(kanji02Ap);
			jc('#KJDSTypeText').string(kanji02TypeTxt);
			HDKJclick(ssSelFlg, '#hdText02SS', '#ssKJTextDummy', '', '', '', '#hdDel02SS', '');
		}
	});

	jc('#hdHdn03SS').click(function() {
		if (ssKJSel1 == 1) {
			HDKJclick(ssSelFlg, '#hdText03SS', '#ssKJText1', '#K1SBpText', '#K1SApText', '#K1STypeText', '#hdDel03SS', '#ssKJRect1');
			if (jc('#ssKJRect1').attr('fill') == 0) {
				ssKJSel1 = 0;
			}
		} else if (ssKJSel2 == 1) {
			HDKJclick(ssSelFlg, '#hdText03SS', '#ssKJText2', '#K2SBpText', '#K2SApText', '#K2STypeText', '#hdDel03SS', '#ssKJRect2');
			if (jc('#ssKJRect2').attr('fill') == 0) {
				ssKJSel2 = 0;
			}
		} else if (ssKJSel3 == 1) {
			HDKJclick(ssSelFlg, '#hdText03SS', '#ssKJText3', '#K3SBpText', '#K3SApText', '#K3STypeText', '#hdDel03SS', '#ssKJRect3');
			if (jc('#ssKJRect3').attr('fill') == 0) {
				ssKJSel3 = 0;
			}
		} else {
			jc('#KJ_DTxtSS').string(jc('#hdText03SS').string());
			jc('#KJDSBpText').string(kanji03Bp);
			jc('#KJDSApText').string(kanji03Ap);
			jc('#KJDSTypeText').string(kanji03TypeTxt);
			HDKJclick(ssSelFlg, '#hdText03SS', '#ssKJTextDummy', '', '', '', '#hdDel03SS', '');
		}
	});

	jc('#hdHdn04SS').click(function() {
		if (ssKJSel1 == 1) {
			HDKJclick(ssSelFlg, '#hdText04SS', '#ssKJText1', '#K1SBpText', '#K1SApText', '#K1STypeText', '#hdDel04SS', '#ssKJRect1');
			if (jc('#ssKJRect1').attr('fill') == 0) {
				ssKJSel1 = 0;
			}
		} else if (ssKJSel2 == 1) {
			HDKJclick(ssSelFlg, '#hdText04SS', '#ssKJText2', '#K2SBpText', '#K2SApText', '#K2STypeText', '#hdDel04SS', '#ssKJRect2');
			if (jc('#ssKJRect2').attr('fill') == 0) {
				ssKJSel2 = 0;
			}
		} else if (ssKJSel3 == 1) {
			HDKJclick(ssSelFlg, '#hdText04SS', '#ssKJText3', '#K3SBpText', '#K3SApText', '#K3STypeText', '#hdDel04SS', '#ssKJRect3');
			if (jc('#ssKJRect3').attr('fill') == 0) {
				ssKJSel3 = 0;
			}
		} else {
			jc('#KJ_DTxtSS').string(jc('#hdText04SS').string());
			jc('#KJDSBpText').string(kanji04Bp);
			jc('#KJDSApText').string(kanji04Ap);
			jc('#KJDSTypeText').string(kanji04TypeTxt);
			HDKJclick(ssSelFlg, '#hdText04SS', '#ssKJTextDummy', '', '', '', '#hdDel04SS', '');
		}
	});

	jc('#hdHdn05SS').click(function() {
		if (ssKJSel1 == 1) {
			HDKJclick(ssSelFlg, '#hdText05SS', '#ssKJText1', '#K1SBpText', '#K1SApText', '#K1STypeText', '#hdDel05SS', '#ssKJRect1');
			if (jc('#ssKJRect1').attr('fill') == 0) {
				ssKJSel1 = 0;
			}
		} else if (ssKJSel2 == 1) {
			HDKJclick(ssSelFlg, '#hdText05SS', '#ssKJText2', '#K2SBpText', '#K2SApText', '#K2STypeText', '#hdDel05SS', '#ssKJRect2');
			if (jc('#ssKJRect2').attr('fill') == 0) {
				ssKJSel2 = 0;
			}
		} else if (ssKJSel3 == 1) {
			HDKJclick(ssSelFlg, '#hdText05SS', '#ssKJText3', '#K3SBpText', '#K3SApText', '#K3STypeText', '#hdDel05SS', '#ssKJRect3');
			if (jc('#ssKJRect3').attr('fill') == 0) {
				ssKJSel3 = 0;
			}
		} else {
			jc('#KJ_DTxtSS').string(jc('#hdText05SS').string());
			jc('#KJDSBpText').string(kanji05Bp);
			jc('#KJDSApText').string(kanji05Ap);
			jc('#KJDSTypeText').string(kanji05TypeTxt);
			HDKJclick(ssSelFlg, '#hdText05SS', '#ssKJTextDummy', '', '', '', '#hdDel05SS', '');
		}
	});

	jc('#hdHdn06SS').click(function() {
		if (ssKJSel1 == 1) {
			HDKJclick(ssSelFlg, '#hdText06SS', '#ssKJText1', '#K1SBpText', '#K1SApText', '#K1STypeText', '#hdDel06SS', '#ssKJRect1');
			if (jc('#ssKJRect1').attr('fill') == 0) {
				ssKJSel1 = 0;
			}
		} else if (ssKJSel2 == 1) {
			HDKJclick(ssSelFlg, '#hdText06SS', '#ssKJText2', '#K2SBpText', '#K2SApText', '#K2STypeText', '#hdDel06SS', '#ssKJRect2');
			if (jc('#ssKJRect2').attr('fill') == 0) {
				ssKJSel2 = 0;
			}
		} else if (ssKJSel3 == 1) {
			HDKJclick(ssSelFlg, '#hdText06SS', '#ssKJText3', '#K3SBpText', '#K3SApText', '#K3STypeText', '#hdDel06SS', '#ssKJRect3');
			if (jc('#ssKJRect3').attr('fill') == 0) {
				ssKJSel3 = 0;
			}
		} else {
			jc('#KJ_DTxtSS').string(jc('#hdText06SS').string());
			jc('#KJDSBpText').string(kanji06Bp);
			jc('#KJDSApText').string(kanji06Ap);
			jc('#KJDSTypeText').string(kanji06TypeTxt);
			HDKJclick(ssSelFlg, '#hdText06SS', '#ssKJTextDummy', '', '', '', '#hdDel06SS', '');
		}
	});

	jc('#hdHdn07SS').click(function() {
		if (ssKJSel1 == 1) {
			HDKJclick(ssSelFlg, '#hdText07SS', '#ssKJText1', '#K1SBpText', '#K1SApText', '#K1STypeText', '#hdDel07SS', '#ssKJRect1');
			if (jc('#ssKJRect1').attr('fill') == 0) {
				ssKJSel1 = 0;
			}
		} else if (ssKJSel2 == 1) {
			HDKJclick(ssSelFlg, '#hdText07SS', '#ssKJText2', '#K2SBpText', '#K2SApText', '#K2STypeText', '#hdDel07SS', '#ssKJRect2');
			if (jc('#ssKJRect2').attr('fill') == 0) {
				ssKJSel2 = 0;
			}
		} else if (ssKJSel3 == 1) {
			HDKJclick(ssSelFlg, '#hdText07SS', '#ssKJText3', '#K3SBpText', '#K3SApText', '#K3STypeText', '#hdDel07SS', '#ssKJRect3');
			if (jc('#ssKJRect3').attr('fill') == 0) {
				ssKJSel3 = 0;
			}
		} else {
			jc('#KJ_DTxtSS').string(jc('#hdText07SS').string());
			jc('#KJDSBpText').string(kanji07Bp);
			jc('#KJDSApText').string(kanji07Ap);
			jc('#KJDSTypeText').string(kanji07TypeTxt);
			HDKJclick(ssSelFlg, '#hdText07SS', '#ssKJTextDummy', '', '', '', '#hdDel07SS', '');
		}
	});

	jc('#hdHdn08SS').click(function() {
		if (ssKJSel1 == 1) {
			HDKJclick(ssSelFlg, '#hdText08SS', '#ssKJText1', '#K1SBpText', '#K1SApText', '#K1STypeText', '#hdDel08SS', '#ssKJRect1');
			if (jc('#ssKJRect1').attr('fill') == 0) {
				ssKJSel1 = 0;
			}
		} else if (ssKJSel2 == 1) {
			HDKJclick(ssSelFlg, '#hdText08SS', '#ssKJText2', '#K2SBpText', '#K2SApText', '#K2STypeText', '#hdDel08SS', '#ssKJRect2');
			if (jc('#ssKJRect2').attr('fill') == 0) {
				ssKJSel2 = 0;
			}
		} else if (ssKJSel3 == 1) {
			HDKJclick(ssSelFlg, '#hdText08SS', '#ssKJText3', '#K3SBpText', '#K3SApText', '#K3STypeText', '#hdDel08SS', '#ssKJRect3');
			if (jc('#ssKJRect3').attr('fill') == 0) {
				ssKJSel3 = 0;
			}
		} else {
			jc('#KJ_DTxtSS').string(jc('#hdText08SS').string());
			jc('#KJDSBpText').string(kanji08Bp);
			jc('#KJDSApText').string(kanji08Ap);
			jc('#KJDSTypeText').string(kanji08TypeTxt);
			HDKJclick(ssSelFlg, '#hdText08SS', '#ssKJTextDummy', '', '', '', '#hdDel08SS', '');
		}
	});

	jc.rect(0, 100, 290, 55, 'rgba(0,255,0)', 1).id('pgRectSS').opacity(0);
	jc.text('登録中…', 50, 145, 'rgb(0,0,0)').id('pgLabelSS').font(TxtFont2).opacity(0);

	jc.rect(10, 385, 120, 38, 'rgba(256,153,0)', 1).shadow({
		x : 5,
		y : 5,
		color : '#000000'
	}).id('Btn_SelOK').layer('L_SS_Btn');

	jc.text('決　定', 70, 417, 'rgb(0,0,0)').font(TxtFont1).align('center').mouseover(function() {
		this.color('rgb(255,255,0)');
	}).mouseout(function() {
		this.color('rgb(0,0,0)');
	}).layer('L_SS_Btn');

	jc('#Btn_SelOK').click(function() {
		if (ssBtnFlg == 0) {
			ssBtnFlg = 1;
			if (jc('#hdDel01SS').opacity() == 1) {
				hdTxt01 = '';
			} else {
				hdTxt01 = jc('#hdText01SS').string();
			}
			if (jc('#hdDel02SS').opacity() == 1) {
				hdTxt02 = '';
			} else {
				hdTxt02 = jc('#hdText02SS').string();
			}
			if (jc('#hdDel03SS').opacity() == 1) {
				hdTxt03 = '';
			} else {
				hdTxt03 = jc('#hdText03SS').string();
			}
			if (jc('#hdDel04SS').opacity() == 1) {
				hdTxt04 = '';
			} else {
				hdTxt04 = jc('#hdText04SS').string();
			}
			if (jc('#hdDel05SS').opacity() == 1) {
				hdTxt05 = '';
			} else {
				hdTxt05 = jc('#hdText05SS').string();
			}
			if (jc('#hdDel06SS').opacity() == 1) {
				hdTxt06 = '';
			} else {
				hdTxt06 = jc('#hdText06SS').string();
			}
			if (jc('#hdDel07SS').opacity() == 1) {
				hdTxt07 = '';
			} else {
				hdTxt07 = jc('#hdText07SS').string();
			}
			if (jc('#hdDel08SS').opacity() == 1) {
				hdTxt08 = '';
			} else {
				hdTxt08 = jc('#hdText08SS').string();
			}

			var SM_2d = new Date();
			$.getJSON('../main/mdSummonCommit' + '?_=' + SM_2d.getMilliseconds(), {
				userId : userId,
				holderKanji01 : hdTxt01,
				holderKanji02 : hdTxt02,
				holderKanji03 : hdTxt03,
				holderKanji04 : hdTxt04,
				holderKanji05 : hdTxt05,
				holderKanji06 : hdTxt06,
				holderKanji07 : hdTxt07,
				holderKanji08 : hdTxt08
			}, callbackSummonSel2, 'json');
			interval_SS3 = setInterval(SSmnStartProgress, 500);
		}
	});

	jc.rect(150, 385, 120, 38, 'rgba(256,153,0)', 1).shadow({
		x : 5,
		y : 5,
		color : '#000000'
	}).id('Btn_SelReturn').mouseover(function() {
		jc('#Btn_SelRtrnLabel').color('rgb(255,255,0)');
	}).mouseout(function() {
		jc('#Btn_SelRtrnLabel').color('rgb(0,0,0)');
	}).click(function() {
		jc.canvas(idCanvas).clear();
		if (userLevel > 6) {
			loadMdSmModeSel(idCanvas);
		} else {
			loadMdMenu(idCanvas);
		}
	}).layer('L_SS_Btn');

	jc.text('戻　る', 210, 417, 'rgb(0,0,0)').font(TxtFont1).align('center').mouseover(function() {
		this.color('rgb(255,255,0)');
	}).mouseout(function() {
		this.color('rgb(0,0,0)');
	}).id('Btn_SelRtrnLabel').layer('L_SS_Btn');

	jc.rect(5, 60, 275, 370, 'rgba(250,250,250,1)', 1).id('KJBookPnSS').layer('L_bookSS');

	jc.rect(7, 62, 271, 28, 'rgba(153,255,255)', 1).layer('L_bookSS');
	jc.text('召喚したい漢字をクリックしよう', 140, 82, 'rgb(0,0,0)').font(TxtFont3).align('center').layer('L_bookSS');

	var KJArrayCnt = 0;
	for (i = 0; i < 5; i++) {
		KJArrayCnt = i + (i * 3);
		jc.text(KJ1TextArray[KJArrayCnt], 60, 145 + (i * 60), 'rgb(0,0,0)').id('K' + (KJArrayCnt + 1) + 'BSText').font(TxtFont6).align('center').mouseover(function() {
			this.color('rgb(255,0,0)');
		}).mouseout(function() {
			this.color('rgb(0,0,0)');
		}).click(function() {
			bookKJSelect(this.string());
		}).layer('L_bookSS');

		jc.text(KJ1TextArray[KJArrayCnt + 1], 115, 145 + (i * 60), 'rgb(0,0,0)').id('K' + (KJArrayCnt + 2) + 'BSText').font(TxtFont6).align('center').mouseover(function() {
			this.color('rgb(255,0,0)');
		}).mouseout(function() {
			this.color('rgb(0,0,0)');
		}).click(function() {
			bookKJSelect(this.string());
		}).layer('L_bookSS');

		jc.text(KJ1TextArray[KJArrayCnt + 2], 170, 145 + (i * 60), 'rgb(0,0,0)').id('K' + (KJArrayCnt + 3) + 'BSText').font(TxtFont6).align('center').mouseover(function() {
			this.color('rgb(255,0,0)');
		}).mouseout(function() {
			this.color('rgb(0,0,0)');
		}).click(function() {
			bookKJSelect(this.string());
		}).layer('L_bookSS');

		jc.text(KJ1TextArray[KJArrayCnt + 3], 225, 145 + (i * 60), 'rgb(0,0,0)').id('K' + (KJArrayCnt + 4) + 'BSText').font(TxtFont6).align('center').mouseover(function() {
			this.color('rgb(255,0,0)');
		}).mouseout(function() {
			this.color('rgb(0,0,0)');
		}).click(function() {
			bookKJSelect(this.string());
		}).layer('L_bookSS');

		jc.text(KJ1YomiArray[KJArrayCnt], 60, 110 + (i * 60), 'rgb(0,0,0)').id('K' + (KJArrayCnt + 1) + 'BSYText').font(TxtFont4).align('center').layer('L_bookSS');
		jc.text(KJ1YomiArray[KJArrayCnt + 1], 115, 110 + (i * 60), 'rgb(0,0,0)').id('K' + (KJArrayCnt + 2) + 'BSYText').font(TxtFont4).align('center').layer('L_bookSS');
		jc.text(KJ1YomiArray[KJArrayCnt + 2], 170, 110 + (i * 60), 'rgb(0,0,0)').id('K' + (KJArrayCnt + 3) + 'BSYText').font(TxtFont4).align('center').layer('L_bookSS');
		jc.text(KJ1YomiArray[KJArrayCnt + 3], 225, 110 + (i * 60), 'rgb(0,0,0)').id('K' + (KJArrayCnt + 4) + 'BSYText').font(TxtFont4).align('center').layer('L_bookSS');

	}

	jc.rect(7, 92, 28, 305, 'rgba(256,153,0)', 1).mouseover(function() {
		jc('#Btn_preBookArrow').color('rgb(255,255,0)');
	}).mouseout(function() {
		jc('#Btn_preBookArrow').color('rgb(0,0,0)');
	}).click(function() {
		if (pageNum == 1) {
			pageNum = pageNumMax;
		} else {
			pageNum = pageNum - 1;
		}
		setBookKJ(pageNum, levelBook);
	}).id('Btn_preBook').layer('L_bookSS');

	jc.line([ [ 10, 252 ], [ 30, 212 ], [ 30, 292 ] ], 1).id('Btn_preBookArrow').mouseover(function() {
		this.color('rgb(255,255,0)');
	}).mouseout(function() {
		this.color('rgb(0,0,0)');
	}).layer('L_bookSS');

	jc.rect(7, 399, 271, 28, 'rgba(256,153,0)', 1).mouseover(function() {
		jc('#Btn_closeBookText').color('rgb(255,255,0)');
	}).mouseout(function() {
		jc('#Btn_closeBookText').color('rgb(0,0,0)');
	}).click(function() {
		levelBook = 0;
		jc.layer('L_bookSS').objects().visible(false);
		jc.layer('L_S_KJ01').objects().visible(true);
		jc.layer('L_S_KJ02').objects().visible(true);
		jc.layer('L_S_KJ03').objects().visible(true);
		jc.layer('L_hd01SS').objects().visible(true);
		jc.layer('L_hd02SS').objects().visible(true);
		jc.layer('L_hd03SS').objects().visible(true);
		jc.layer('L_hd04SS').objects().visible(true);
		jc.layer('L_hd05SS').objects().visible(true);
		jc.layer('L_hd06SS').objects().visible(true);
		jc.layer('L_hd07SS').objects().visible(true);
		jc.layer('L_hd08SS').objects().visible(true);
		jc.layer('L_SS_Btn').objects().visible(true);
	}).id('Btn_closeBook').layer('L_bookSS');

	jc.text('閉 じ る', 140, 420, 'rgb(0,0,0)').font(TxtFont5).align('center').id('Btn_closeBookText').mouseover(function() {
		this.color('rgb(255,255,0)');
	}).mouseout(function() {
		this.color('rgb(0,0,0)');
	}).layer('L_bookSS');

	jc.rect(250, 92, 28, 305, 'rgba(256,153,0)', 1).mouseover(function() {
		jc('#Btn_nextBookArrow').color('rgb(255,255,0)');
	}).mouseout(function() {
		jc('#Btn_nextBookArrow').color('rgb(0,0,0)');
	}).click(function() {
		if (pageNum == pageNumMax) {
			pageNum = 1;
		} else {
			pageNum = pageNum + 1;
		}
		setBookKJ(pageNum, levelBook);
	}).id('Btn_nextBook').layer('L_bookSS');

	jc.line([ [ 276, 252 ], [ 256, 212 ], [ 256, 292 ] ], 1).id('Btn_nextBookArrow').mouseover(function() {
		this.color('rgb(255,255,0)');
	}).mouseout(function() {
		this.color('rgb(0,0,0)');
	}).layer('L_bookSS');

	// 本画像の描画
	var imgSS02 = new Image();
	imgSS02.src = '/static/image/book.png';
	imgSS02.onload = function() {
		jc.image(imgSS02, 8, -5).id('ICON_SEL_BOOK');
		jc.rect(5, 3, 42, 55, 'rgba(0,0,0,1)', 0).opacity(0).click(function() {
			jc.layer('Layer_SST').objects().opacity(0);
			pageNum = 1;
			pageNumMax = 4;
			levelBook = 1;
			setBookKJ(pageNum, levelBook);
			jc.layer('L_bookSS').objects().visible(true);
			jc.layer('L_S_KJ01').objects().visible(false);
			jc.layer('L_S_KJ02').objects().visible(false);
			jc.layer('L_S_KJ03').objects().visible(false);
			jc.layer('L_hd01SS').objects().visible(false);
			jc.layer('L_hd02SS').objects().visible(false);
			jc.layer('L_hd03SS').objects().visible(false);
			jc.layer('L_hd04SS').objects().visible(false);
			jc.layer('L_hd05SS').objects().visible(false);
			jc.layer('L_hd06SS').objects().visible(false);
			jc.layer('L_hd07SS').objects().visible(false);
			jc.layer('L_hd08SS').objects().visible(false);
			jc.layer('L_SS_Btn').objects().visible(false);
		}).id('KJBook1SS').layer('L_bookTopSS');

		jc.rect(52, 3, 42, 55, 'rgba(0,0,0,1)', 0).opacity(0).click(function() {
			if(userLevel < 2){
				alert("この学年の漢字を呼び出すには\nまだレベルが足らないよ！");
			} else {
				pageNum = 1;
				pageNumMax = 8;
				levelBook = 2;
				setBookKJ(pageNum, levelBook);
				jc.layer('L_bookSS').objects().visible(true);
				jc.layer('L_S_KJ01').objects().visible(false);
				jc.layer('L_S_KJ02').objects().visible(false);
				jc.layer('L_S_KJ03').objects().visible(false);
				jc.layer('L_hd01SS').objects().visible(false);
				jc.layer('L_hd02SS').objects().visible(false);
				jc.layer('L_hd03SS').objects().visible(false);
				jc.layer('L_hd04SS').objects().visible(false);
				jc.layer('L_hd05SS').objects().visible(false);
				jc.layer('L_hd06SS').objects().visible(false);
				jc.layer('L_hd07SS').objects().visible(false);
				jc.layer('L_hd08SS').objects().visible(false);
				jc.layer('L_SS_Btn').objects().visible(false);
			}
		}).id('KJBook2SS').layer('L_bookTopSS');

		jc.rect(99, 3, 42, 55, 'rgba(0,0,0,1)', 0).opacity(0).click(function() {
			if(userLevel < 3){
				alert("この学年の漢字を呼び出すには\nまだレベルが足らないよ！");
			} else {
				pageNum = 1;
				pageNumMax = 10;
				levelBook = 3;
				setBookKJ(pageNum, levelBook);
				jc.layer('L_bookSS').objects().visible(true);
				jc.layer('L_S_KJ01').objects().visible(false);
				jc.layer('L_S_KJ02').objects().visible(false);
				jc.layer('L_S_KJ03').objects().visible(false);
				jc.layer('L_hd01SS').objects().visible(false);
				jc.layer('L_hd02SS').objects().visible(false);
				jc.layer('L_hd03SS').objects().visible(false);
				jc.layer('L_hd04SS').objects().visible(false);
				jc.layer('L_hd05SS').objects().visible(false);
				jc.layer('L_hd06SS').objects().visible(false);
				jc.layer('L_hd07SS').objects().visible(false);
				jc.layer('L_hd08SS').objects().visible(false);
				jc.layer('L_SS_Btn').objects().visible(false);
			}
		}).id('KJBook3SS').layer('L_bookTopSS');

		jc.rect(146, 3, 42, 55, 'rgba(0,0,0,1)', 0).opacity(0).click(function() {
			if(userLevel < 4){
				alert("この学年の漢字を呼び出すには\nまだレベルが足らないよ！");
			} else {
				pageNum = 1;
				pageNumMax = 10;
				levelBook = 4;
				setBookKJ(pageNum, levelBook);
				jc.layer('L_bookSS').objects().visible(true);
				jc.layer('L_S_KJ01').objects().visible(false);
				jc.layer('L_S_KJ02').objects().visible(false);
				jc.layer('L_S_KJ03').objects().visible(false);
				jc.layer('L_hd01SS').objects().visible(false);
				jc.layer('L_hd02SS').objects().visible(false);
				jc.layer('L_hd03SS').objects().visible(false);
				jc.layer('L_hd04SS').objects().visible(false);
				jc.layer('L_hd05SS').objects().visible(false);
				jc.layer('L_hd06SS').objects().visible(false);
				jc.layer('L_hd07SS').objects().visible(false);
				jc.layer('L_hd08SS').objects().visible(false);
				jc.layer('L_SS_Btn').objects().visible(false);
			}
		}).id('KJBook4SS').layer('L_bookTopSS');

		jc.rect(193, 3, 42, 55, 'rgba(0,0,0,1)', 0).opacity(0).click(function() {
			if(userLevel < 5){
				alert("この学年の漢字を呼び出すには\nまだレベルが足らないよ！");
			} else {
				pageNum = 1;
				pageNumMax = 10;
				levelBook = 5;
				setBookKJ(pageNum, levelBook);
				jc.layer('L_bookSS').objects().visible(true);
				jc.layer('L_S_KJ01').objects().visible(false);
				jc.layer('L_S_KJ02').objects().visible(false);
				jc.layer('L_S_KJ03').objects().visible(false);
				jc.layer('L_hd01SS').objects().visible(false);
				jc.layer('L_hd02SS').objects().visible(false);
				jc.layer('L_hd03SS').objects().visible(false);
				jc.layer('L_hd04SS').objects().visible(false);
				jc.layer('L_hd05SS').objects().visible(false);
				jc.layer('L_hd06SS').objects().visible(false);
				jc.layer('L_hd07SS').objects().visible(false);
				jc.layer('L_hd08SS').objects().visible(false);
				jc.layer('L_SS_Btn').objects().visible(false);
			}
		}).id('KJBook5SS').layer('L_bookTopSS');

		jc.rect(240, 3, 42, 55, 'rgba(0,0,0,1)', 0).opacity(0).click(function() {
			if(userLevel < 6){
				alert("この学年の漢字を呼び出すには\nまだレベルが足らないよ！");
			} else {
				pageNum = 1;
				pageNumMax = 10;
				levelBook = 6;
				setBookKJ(pageNum, levelBook);
				jc.layer('L_bookSS').objects().visible(true);
				jc.layer('L_S_KJ01').objects().visible(false);
				jc.layer('L_S_KJ02').objects().visible(false);
				jc.layer('L_S_KJ03').objects().visible(false);
				jc.layer('L_hd01SS').objects().visible(false);
				jc.layer('L_hd02SS').objects().visible(false);
				jc.layer('L_hd03SS').objects().visible(false);
				jc.layer('L_hd04SS').objects().visible(false);
				jc.layer('L_hd05SS').objects().visible(false);
				jc.layer('L_hd06SS').objects().visible(false);
				jc.layer('L_hd07SS').objects().visible(false);
				jc.layer('L_hd08SS').objects().visible(false);
				jc.layer('L_SS_Btn').objects().visible(false);
			}
		}).id('KJBook6SS').layer('L_bookTopSS');
	}

	// jc.layer('L_SS_Btn').objects().visible(false);
	jc.layer('L_bookSS').objects().visible(false);

	if (firstLogin == '1') {
		// 詳細パネル描画
		jc.rect(0, 155, 290, 150, 'rgba(0,255,0)', 1).id('display').opacity(0.8).layer('Layer_SST');
		jc.text("最初は１年生の漢字が使えるよ", 140, 190, 'rgb(0,0,0)').id("dt1SS").font(TxtFont5).align('center').opacity(1).layer('Layer_SST');
		jc.text("左上の一年の本をクリックして", 140, 220, 'rgb(0,0,0)').id("dt2SS").font(TxtFont5).align('center').opacity(1).layer('Layer_SST');
		jc.text("辞書を開いたあとに、使いたい", 140, 250, 'rgb(0,0,0)').id("dt3SS").align('center').font(TxtFont5).opacity(1).layer('Layer_SST');
		jc.text("漢字をクリックして選んでね", 140, 280, 'rgb(0,0,0)').id("dt4SS").align('center').font(TxtFont5).opacity(1).layer('Layer_SST');

		jc.layer('Layer_SST').objects().click(function() {
			jc.layer('Layer_SST').objects().opacity(0);
		});
	}

	jc.rect(40, 270, 200, 100, 'rgba(0,255,0,1)', 1).id('KJ_Disc1SS').layer('L_KJD_SS');
	jc.rect(43, 273, 194, 94, 'rgba(102,255,255,1)', 1).id('KJ_Disc2SS').layer('L_KJD_SS');
	jc.text("壱", 80, 320, 'rgb(0,0,0)').id("KJ_DTxtSS").font(TxtFont2).align('center').layer('L_KJD_SS');
	jc.text('　体力：', 130, 290, 'rgb(0,0,0)').font(TxtFont4).layer('L_KJD_SS');
	jc.text('攻撃力：', 130, 305, 'rgb(0,0,0)').font(TxtFont4).layer('L_KJD_SS');
	jc.text('　属性：', 130, 320, 'rgb(0,0,0)').font(TxtFont4).layer('L_KJD_SS');
	jc.text('', 180, 290, 'rgb(0,0,0)').id('KJDSBpText').font(TxtFont4).layer('L_KJD_SS');
	jc.text('', 180, 305, 'rgb(0,0,0)').id('KJDSApText').font(TxtFont4).layer('L_KJD_SS');
	jc.text('', 180, 320, 'rgb(0,0,0)').id('KJDSTypeText').font(TxtFont4).layer('L_KJD_SS');
	jc.text('', 0, 0, 'rgb(0,0,0)').id('KJDSDummy').opacity(0).layer('L_KJD_SS');

	jc.rect(50, 335, 100, 28, 'rgba(256,153,0)', 1).mouseover(function() {
		jc('#Btn_delKJDText').color('rgb(255,255,0)');
	}).mouseout(function() {
		jc('#Btn_delKJDText').color('rgb(0,0,0)');
	}).click(function() {
		jc(jc('#KJDSDummy').string()).string('');
		jc('#KJDSDummy').string('');
		jc.layer('L_KJD_SS').objects().visible(false);
		jc('#hdHdn01SS').visible(true);
		jc('#hdHdn02SS').visible(true);
		jc('#hdHdn03SS').visible(true);
		jc('#hdHdn04SS').visible(true);
		jc('#hdHdn05SS').visible(true);
		jc('#hdHdn06SS').visible(true);
		jc('#hdHdn07SS').visible(true);
		jc('#hdHdn08SS').visible(true);
	}).id('Btn_delKJD').layer('L_KJD_SS');

	jc.text('漢字を消す', 100, 355, 'rgb(0,0,0)').font(TxtFont5).align('center').id('Btn_delKJDText').mouseover(function() {
		this.color('rgb(255,255,0)');
	}).mouseout(function() {
		this.color('rgb(0,0,0)');
	}).layer('L_KJD_SS');

	jc.rect(155, 335, 75, 28, 'rgba(256,153,0)', 1).mouseover(function() {
		jc('#Btn_closeKJDText').color('rgb(255,255,0)');
	}).mouseout(function() {
		jc('#Btn_closeKJDText').color('rgb(0,0,0)');
	}).click(function() {
		jc('#KJDSDummy').string('');
		jc.layer('L_KJD_SS').objects().visible(false);
		jc('#hdHdn01SS').visible(true);
		jc('#hdHdn02SS').visible(true);
		jc('#hdHdn03SS').visible(true);
		jc('#hdHdn04SS').visible(true);
		jc('#hdHdn05SS').visible(true);
		jc('#hdHdn06SS').visible(true);
		jc('#hdHdn07SS').visible(true);
		jc('#hdHdn08SS').visible(true);
	}).id('Btn_closeKJD').layer('L_KJD_SS');

	jc.text('閉じる', 195, 355, 'rgb(0,0,0)').font(TxtFont5).align('center').id('Btn_closeKJDText').mouseover(function() {
		this.color('rgb(255,255,0)');
	}).mouseout(function() {
		this.color('rgb(0,0,0)');
	}).layer('L_KJD_SS');

	jc.layer('L_KJD_SS').objects().visible(false);

	jc.start(idCanvas, true);

}

function setBookKJ(pageNumBook, level) {

	var strBookKJ = '';
	var strBookKJYomi = '';

	for (i = 0; i < 20; i++) {

		switch (level) {
		case 1:
			strBookKJ = KJ1TextArray[((pageNumBook - 1) * 20) + i];
			strBookKJYomi = KJ1YomiArray[((pageNumBook - 1) * 20) + i];
			break;
		case 2:
			strBookKJ = KJ2TextArray[((pageNumBook - 1) * 20) + i];
			strBookKJYomi = KJ2YomiArray[((pageNumBook - 1) * 20) + i];
			break;
		case 3:
			strBookKJ = KJ3TextArray[((pageNumBook - 1) * 20) + i];
			strBookKJYomi = KJ3YomiArray[((pageNumBook - 1) * 20) + i];
			break;
		case 4:
			strBookKJ = KJ4TextArray[((pageNumBook - 1) * 20) + i];
			strBookKJYomi = KJ4YomiArray[((pageNumBook - 1) * 20) + i];
			break;
		case 5:
			strBookKJ = KJ5TextArray[((pageNumBook - 1) * 20) + i];
			strBookKJYomi = KJ5YomiArray[((pageNumBook - 1) * 20) + i];
			break;
		case 6:
			strBookKJ = KJ6TextArray[((pageNumBook - 1) * 20) + i];
			strBookKJYomi = KJ6YomiArray[((pageNumBook - 1) * 20) + i];
			break;
		default:
			strBookKJ = '';
			strBookKJYomi = '';
			break;
		}

		jc('#K' + (i + 1) + 'BSText').string(strBookKJ);
		jc('#K' + (i + 1) + 'BSYText').string(strBookKJYomi);
	}
}

function bookKJSelect(selectKJ) {
	if (jc('#ssKJText1').string() == '') {
		jc('#ssKJText1').string(selectKJ);
		jc('#ssKJText1').opacity(1);
		jc('#ssKJLevel1').string(levelBook);
		levelBook = 0;
		jc.layer('L_bookSS').objects().visible(false);
		jc.layer('L_S_KJ01').objects().visible(true);
		jc.layer('L_S_KJ02').objects().visible(true);
		jc.layer('L_S_KJ03').objects().visible(true);
		jc.layer('L_hd01SS').objects().visible(true);
		jc.layer('L_hd02SS').objects().visible(true);
		jc.layer('L_hd03SS').objects().visible(true);
		jc.layer('L_hd04SS').objects().visible(true);
		jc.layer('L_hd05SS').objects().visible(true);
		jc.layer('L_hd06SS').objects().visible(true);
		jc.layer('L_hd07SS').objects().visible(true);
		jc.layer('L_hd08SS').objects().visible(true);
		jc.layer('L_SS_Btn').objects().visible(true);
	} else if (jc('#ssKJText2').string() == '') {
		jc('#ssKJText2').string(selectKJ);
		jc('#ssKJText2').opacity(1);
		jc('#ssKJLevel2').string(levelBook);
		levelBook = 0;
		jc.layer('L_bookSS').objects().visible(false);
		jc.layer('L_S_KJ01').objects().visible(true);
		jc.layer('L_S_KJ02').objects().visible(true);
		jc.layer('L_S_KJ03').objects().visible(true);
		jc.layer('L_hd01SS').objects().visible(true);
		jc.layer('L_hd02SS').objects().visible(true);
		jc.layer('L_hd03SS').objects().visible(true);
		jc.layer('L_hd04SS').objects().visible(true);
		jc.layer('L_hd05SS').objects().visible(true);
		jc.layer('L_hd06SS').objects().visible(true);
		jc.layer('L_hd07SS').objects().visible(true);
		jc.layer('L_hd08SS').objects().visible(true);
		jc.layer('L_SS_Btn').objects().visible(true);
	} else if (jc('#ssKJText3').string() == '') {
		jc('#ssKJText3').string(selectKJ);
		jc('#ssKJText3').opacity(1);
		jc('#ssKJLevel3').string(levelBook);
		levelBook = 0;
		jc.layer('L_bookSS').objects().visible(false);
		jc.layer('L_S_KJ01').objects().visible(true);
		jc.layer('L_S_KJ02').objects().visible(true);
		jc.layer('L_S_KJ03').objects().visible(true);
		jc.layer('L_hd01SS').objects().visible(true);
		jc.layer('L_hd02SS').objects().visible(true);
		jc.layer('L_hd03SS').objects().visible(true);
		jc.layer('L_hd04SS').objects().visible(true);
		jc.layer('L_hd05SS').objects().visible(true);
		jc.layer('L_hd06SS').objects().visible(true);
		jc.layer('L_hd07SS').objects().visible(true);
		jc.layer('L_hd08SS').objects().visible(true);
		jc.layer('L_SS_Btn').objects().visible(true);
	} else {
		alert("一度に召喚できる漢字は３つまでです！\nクリアボタンで漢字を消してください");
	}
}

function HDKJclick(inFlg, hdText, sdText, bpText, apText, typeText, hdDel, kjRect) {
	var checkTxt = '';

	if (inFlg == 1) {
		return;
	}
	if (jc(hdText).string() == '') {
		if (jc(sdText).string() == '') {
			// alert("召喚された漢字がありません");
		} else {
			if (jc('#hdText01SS').string() == jc(sdText).string()
				|| jc('#hdText02SS').string() == jc(sdText).string()
				|| jc('#hdText03SS').string() == jc(sdText).string()
				|| jc('#hdText04SS').string() == jc(sdText).string()
				|| jc('#hdText05SS').string() == jc(sdText).string()
				|| jc('#hdText06SS').string() == jc(sdText).string()
				|| jc('#hdText07SS').string() == jc(sdText).string()
				|| jc('#hdText08SS').string() == jc(sdText).string()) {
				alert("同じ漢字を２つ以上持つことはできません");
			} else {
				ssSelFlg = 1;
				jc(hdText).opacity(0);
				jc(bpText).fadeOut(1000);
				jc(apText).fadeOut(1000);
				jc(typeText).fadeOut(1000);
				jc(sdText).fadeOut(1000, function() {
					if (hdText == '#hdText01SS') {
						kanji01Bp = jc(bpText).string();
						kanji01Ap = jc(apText).string();
						kanji01TypeTxt = jc(typeText).string();
					} else if(hdText == '#hdText02SS'){
						kanji02Bp = jc(bpText).string();
						kanji02Ap = jc(apText).string();
						kanji02TypeTxt = jc(typeText).string();
					} else if(hdText == '#hdText03SS'){
						kanji03Bp = jc(bpText).string();
						kanji03Ap = jc(apText).string();
						kanji03TypeTxt = jc(typeText).string();
					} else if(hdText == '#hdText04SS'){
						kanji04Bp = jc(bpText).string();
						kanji04Ap = jc(apText).string();
						kanji04TypeTxt = jc(typeText).string();
					} else if(hdText == '#hdText05SS'){
						kanji05Bp = jc(bpText).string();
						kanji05Ap = jc(apText).string();
						kanji05TypeTxt = jc(typeText).string();
					} else if(hdText == '#hdText06SS'){
						kanji06Bp = jc(bpText).string();
						kanji06Ap = jc(apText).string();
						kanji06TypeTxt = jc(typeText).string();
					} else if(hdText == '#hdText07SS'){
						kanji07Bp = jc(bpText).string();
						kanji07Ap = jc(apText).string();
						kanji07TypeTxt = jc(typeText).string();
					} else {
						kanji08Bp = jc(bpText).string();
						kanji08Ap = jc(apText).string();
						kanji08TypeTxt = jc(typeText).string();
					}
					jc(sdText).string('');
					jc(bpText).string('');
					jc(apText).string('');
					jc(typeText).string('');
					ssSelFlg = 0;
					if (firstLogin == '1') {
						jc('#dt1SS').string("漢字が下に移動したね！");
						jc('#dt2SS').string("さいごに決定ボタンを");
						jc('#dt3SS').string("クリックすれば、呼び出した");
						jc('#dt4SS').string("漢字が自分のものになるよ！");
						jc.layer('Layer_SST').objects().opacity(0.8);
						firstLogin = 2;
						setTimeout(ssmnFadeOut, 5000 );
					}

				});
				jc(hdText).string(jc(sdText).string());
				jc(hdText).fadeIn(2000);
				jc(kjRect).color('rgba(0,0,0,1)').attr('fill', 0);
			}
		}
	} else {
		checkTxt = jc(hdText).string();
		jc('#KJDSDummy').string(hdText);
		jc('#hdHdn01SS').visible(false);
		jc('#hdHdn02SS').visible(false);
		jc('#hdHdn03SS').visible(false);
		jc('#hdHdn04SS').visible(false);
		jc('#hdHdn05SS').visible(false);
		jc('#hdHdn06SS').visible(false);
		jc('#hdHdn07SS').visible(false);
		jc('#hdHdn08SS').visible(false);
		jc.layer('L_KJD_SS').objects().visible(true);
		if (checkTxt == useTxt01 || checkTxt == useTxt02 || checkTxt == useTxt03) {
			jc('#Btn_delKJD').visible(false);
			jc('#Btn_delKJDText').visible(false);
		}
	}
}

function SSmnStartProgress() {
	jc('#pgRectSS').opacity(1);
	jc('#pgLabelSS').fadeIn(500, function() {
		this.fadeOut(500);
	});
	if (pgStatus == 1) {
		jc('#pgRectSS').opacity(0);
		jc('#pgLabelSS').opacity(0);
		ssBtnFlg = 0;
		pgStatus = 0;
		clearInterval(interval_SS3);
		jc('#pgRectSS').fadeIn(1000, function() {
			this.fadeOut(1000);
		});
		jc('#pgLabelSS').fadeIn(1000, function() {
			this.fadeOut(1000, function() {
				if (jc('#hdDel01SS').opacity() == 1) {
					jc('#hdDel01SS').opacity(0);
					jc('#hdText01SS').opacity(0);
					jc('#hdText01SS').string('');
				}
				if (jc('#hdDel02SS').opacity() == 1) {
					jc('#hdDel02SS').opacity(0);
					jc('#hdText02SS').opacity(0);
					jc('#hdText02SS').string('');
				}
				if (jc('#hdDel03SS').opacity() == 1) {
					jc('#hdDel03SS').opacity(0);
					jc('#hdText03SS').opacity(0);
					jc('#hdText03SS').string('');
				}
				if (jc('#hdDel04SS').opacity() == 1) {
					jc('#hdDel04SS').opacity(0);
					jc('#hdText04SS').opacity(0);
					jc('#hdText04SS').string('');
				}
				if (jc('#hdDel05SS').opacity() == 1) {
					jc('#hdDel05SS').opacity(0);
					jc('#hdText05SS').opacity(0);
					jc('#hdText05SS').string('');
				}
				if (jc('#hdDel06SS').opacity() == 1) {
					jc('#hdDel06SS').opacity(0);
					jc('#hdText06SS').opacity(0);
					jc('#hdText06SS').string('');
				}
				if (jc('#hdDel07SS').opacity() == 1) {
					jc('#hdDel07SS').opacity(0);
					jc('#hdText07SS').opacity(0);
					jc('#hdText07SS').string('');
				}
				if (jc('#hdDel08SS').opacity() == 1) {
					jc('#hdDel08SS').opacity(0);
					jc('#hdText08SS').opacity(0);
					jc('#hdText08SS').string('');
				}
			});
		});
	} else if (pgStatus == 2) {
		jc('#pgRectSS').opacity(1);
		jc('#pgLabelSS').opacity(1);
		ssBtnFlg = 0;
		pgStatus = 0;
		clearInterval(interval_SS3);
	}
}

function SSmnStartBubble() {
	var r = 255, g = 255, b = Math.floor(Math.random() * (254)), x = Math.floor(Math.random() * (80)), y = Math.floor(Math.random() * (80)), color = "rgba(" + r + ", " + g + ", " + b + ", 0.8)", filled = true, radius = 1;

	if (jc('#ssKJText1').string() != '' && b_Flg1 == 1) {
		jc('#ssKJText1').rotate(360, 'center', {
			x : 0,
			y : 7
		}, 1500);
		jc.circle(x + 10, y + 60, radius, color, filled).animate({
			radius : 20,
			opacity : 0
		}, 1000, function() {
			this.del();
		});
	}
	if (jc('#ssKJText2').string() != '' && b_Flg2 == 1) {
		jc('#ssKJText2').rotate(360, 'center', {
			x : 0,
			y : 7
		}, 1500);
		jc.circle(x + 100, y + 60, radius, color, filled).animate({
			radius : 20,
			opacity : 0
		}, 1000, function() {
			this.del();
		});
	}
	if (jc('#ssKJText3').string() != '' && b_Flg3 == 1) {
		jc('#ssKJText3').rotate(360, 'center', {
			x : 0,
			y : 7
		}, 1500);
		jc.circle(x + 200, y + 60, radius, color, filled).animate({
			radius : 20,
			opacity : 0
		}, 1000, function() {
			this.del();
		});
	}
	if (sSummonFlg == 1 && ssBubbleFlg == 1) {
		jc('#K1SBpText').fadeIn(1000);
		jc('#K1SApText').fadeIn(1000);
		jc('#K1STypeText').fadeIn(1000);
		jc('#K2SBpText').fadeIn(1000);
		jc('#K2SApText').fadeIn(1000);
		jc('#K2STypeText').fadeIn(1000);
		jc('#K3SBpText').fadeIn(1000);
		jc('#K3SApText').fadeIn(1000);
		jc('#K3STypeText').fadeIn(1000);
		b_Flg1 = 0;
		b_Flg2 = 0;
		b_Flg3 = 0;
		ssBtnFlg = 0;
		sSummonFlg = 0;
		ssBubbleFlg = 0;
		clearInterval(interval_SS1);
	}
}

function SSmnStopBubble() {
	ssBubbleFlg = 1;
	clearInterval(interval_SS2);
	if (firstLogin == '1') {
		jc('#dt1SS').string("漢字の能力が出てきたね！");
		jc('#dt2SS').string("気に入ったら漢字をクリックして");
		jc('#dt3SS').string("漢字が青色になったら、");
		jc('#dt4SS').string("下の枠をクリックしてみよう！");
		jc.layer('Layer_SST').objects().opacity(0.8);
		setTimeout(ssmnFadeOut, 5000 );
	}
}

function callbackSummonSel1(result) {
	if (result.summonedTxt1 == '') {
		jc('#K1SBpText').string('');
		jc('#K1SApText').string('');
		jc('#K1STypeText').string('');
	} else {
		jc('#K1SBpText').string(result.barPoint1);
		jc('#K1SApText').string(result.attackPoint1);
		jc('#K1STypeText').string(result.kanjiType1);
	}
	if (result.summonedTxt2 == '') {
		jc('#K2SBpText').string('');
		jc('#K2SApText').string('');
		jc('#K2STypeText').string('');
	} else {
		jc('#K2SBpText').string(result.barPoint2);
		jc('#K2SApText').string(result.attackPoint2);
		jc('#K2STypeText').string(result.kanjiType2);
	}
	if (result.summonedTxt3 == '') {
		jc('#K3SBpText').string('');
		jc('#K3SApText').string('');
		jc('#K3STypeText').string('');
	} else {
		jc('#K3SBpText').string(result.barPoint3);
		jc('#K3SApText').string(result.attackPoint3);
		jc('#K3STypeText').string(result.kanjiType3);
	}
	sSummonFlg = 1;
}

function callbackSummonSel2(result) {
	pgStatus = 1;
	if (result.userId == '') {
		jc('#pgLabelSS').string('登録失敗');
		pgStatus = 2;
	} else {
		jc('#pgLabelSS').string('登録成功');
	}
}
function ssmnFadeOut() {
	jc.layer('Layer_SST').objects().fadeOut(1000);
}
